package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.News;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface NewsMapper {

    int deleteByPrimaryKey(Long id);

    int insert(News record);

    News selectByPrimaryKey(Long id);

    List<News> selectAll();

    int updateByPrimaryKey(News record);

    List<News> selectForList(QueryObject qo);

    List<News> selectNewsStateByuserId(QueryObject qo);

    void updateIsRelease(@Param("id") Long id,
                         @Param("isRelease") Integer isRelease,
                         @Param("releaseTime") Date date);


    void updateStateById(@Param("id") Long id,
                         @Param("state") Integer state);

    List<News> getNewsByTypeId(@Param("typeId") Long typeId,
                               @Param("id") Long id);
}